//
//  WZGOrderPayWechatAlertTopView.m
//  ZCJZ
//
//  Created by sujeking on 2019/9/19.
//  Copyright © 2019 jeking. All rights reserved.
//

#import "WZGOrderPayWechatAlertTopView.h"
#import "TBCityIconFont.h"
#import <BlocksKit+UIKit.h>
#import "ZCBaseUserManager.h"

@interface WZGOrderPayWechatAlertTopView()

@property (weak, nonatomic) IBOutlet UIButton *closeBtn;
@property (weak, nonatomic) IBOutlet UILabel *priceLabel;
@property (weak, nonatomic) IBOutlet UIButton *blanceBtn;

@end


@implementation WZGOrderPayWechatAlertTopView


- (void)awakeFromNib {
    [super awakeFromNib];
    [self setupSubViews];
}

- (void)setupSubViews {
    [self.closeBtn setTitle:nil forState:UIControlStateNormal];
    self.closeBtn.backgroundColor = [UIColor whiteColor];
    self.blanceBtn.userInteractionEnabled = NO;
    
    UIImage *img = [UIImage iconWithInfo:TBCityIconInfoMake(@"\U0000e61e", 25, [generalToolBox getColorWithHexadecimalColorStr:@"0xC3C3C3"])];
    img = [img imageWithRenderingMode:UIImageRenderingModeAlwaysOriginal];
    [self.closeBtn setImage:img forState:UIControlStateNormal];
    [self.closeBtn bk_addEventHandler:^(id sender) {
        if (self.btnClickCallback) {
            self.btnClickCallback();
        }
    } forControlEvents:UIControlEventTouchUpInside];
    
    ZCBaseUserManager *manager = [ZCBaseUserManager shareInstance];
    ZCBaseUserModel *userModel = manager.userModel;
    [self.blanceBtn setTitle:[NSString stringWithFormat:@"余额支付(剩余%.2f元)",userModel.member.wallet.floatValue] forState:UIControlStateNormal];
}

- (void)setPriceStr:(NSString *)priceStr {
    _priceStr = priceStr;
    self.priceLabel.text = [NSString stringWithFormat:@"￥%.2f",priceStr.floatValue];
}


@end
